#define _CRT_SECURE_NO_WARNINGS 1
#include<queue>
#include<iostream>
using namespace std;
int main()
{
	priority_queue < int, vector<int>, greater<int>> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);

	cout << q.top() << endl;
	q.pop();
	cout << q.top() << endl;
	q.pop();
	cout << q.top() << endl;
	q.pop();
	cout << q.top() << endl;
	q.pop();





	return 0;
}